home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 21
/
Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso
/
Aminet
/
comm
/
cnet
/
INetShell.lha
/
INetShell
/
text
/
shell_hFiTP
< prev
next >
Wrap
Text File
|
1997-02-18
|
80KB
|
898 lines
cfz4 INetShell - Help: FTP (File Transfer Protocol) c7
c7z4 c7
c7z4 Q=Quit N=NEXT PG P=PREV PG [DN-ARROWN]=NEXT LINE [UP-ARROW]= PREV LINE c7
c7z0 c7
cbz0 [DOCUMENTATION START] c7
c7z0 c7
c7z0 DESCRIPTION: File Transfer Protocol (FTP) menuing system c7
c7z0 c7
c7z0 The FTP menu subsystem allows you to easily pick sites to FTP to. The menu c7
c7z0 system allows you to move from one directory to another and page from one to c7
c7z0 the next. It even allows you to pick from sites listed in your personal c7
c7z0 notebook database file (see help on NOTEBOOK). c7
c7z0 c7
c7z0 Commands listed on the FTP menu are: c7
c7z0 c7
c7z0 c7
c7z0 # - NUMBER OF THE MENU ITEM c7
c7z0 This option allows you to pick from the list of available FTP sites c7
c7z0 presently shown on your screen. The listing can be a subdirectory c7
c7z0 (ie MENU) or a site description. Entering the number of the site list c7
c7z0 will send you directly to the FTP client and attempt a connection to the c7
c7z0 selected site. c7
c7z0 c7
c7z0 c7
c7z0 M - MANUAL SITE ENTRY c7
c7z0 This option allows you to enter any desired FTP site that you wish to c7
c7z0 visit. You will be presented with a popup screen in which you can enter c7
c7z0 the desired domain name or IP address that you wish to visit. c7
c7z0 c7
c7z0 c7
c7z0 U - USER ENTRY c7
c7z0 This option only appears if there are entries in your notebook database c7
c7z0 file for FTP sites. (See help file on NOTEBOOK). Choosing this option c7
c7z0 (if available) will pull up your entries from your FTP notebook database c7
c7z0 and allow you to choose from your personally entered list of sites. c7
c7z0 c7
c7z0 c7
c7z0 N - NEXT PAGE c7
c7z0 This option only appears if there is a next page available to display. c7
c7z0 c7
c7z0 c7
c7z0 P - PREVIOUS PAGE c7
c7z0 This option only appears if there is a previous page available to c7
c7z0 display. c7
c7z0 c7
c7z0 c7
c7z0 Q - QUIT TO MAIN c7
c7z0 Quit and return to either the INetShell main menu or the Main FTP menu if c7
c7z0 you are in the user entry selection section. c7
c7z0 c7
c7z0 c7
c7z0 c7
c7z0 NcFTP Client Commands: c7
c7z0 c7
c7z0 c7
c7z0 SYNOPSIS c7
c7z0 ncftp [program options] [[open options] [hostname[:pathname]] c7
c7z0 c7
c7z0 c7
c7z0 DESCRIPTION c7
c7z0 NcFTP is a user interface to the Internet standard File Transfer Protocol. c7
c7z0 This program allows a user to transfer file to and from a remote network c7
c7z0 site, and offers additional features that are not found in the standard c7
c7z0 interface, ftp. c7
c7z0 c7
c7z0 c7
c7z0 FEATURES c7
c7z0 Program options will be explained later in this document. Let's get down c7
c7z0 business and go over the features that make this program worthwhile. c7
c7z0 c7
c7z0 Here is the list of section headers: I have my $MANPAGER environment c7
c7z0 variable set to use "less -i" so that I can skip to the section I want c7
c7z0 (otherwise, /regex commands to the pager won't match the section headers c7
c7z0 because of the formatting codes; the "-i" can search through the c7
c7z0 formating codes) c7
c7z0 c7
c7z0 - Estabilishing the remote connection c7
c7z0 - Format of the RC file c7
c7z0 - The Recent-sites file c7
c7z0 - Redialing a busy remote site c7
c7z0 - Supplying a sitename from your shell's command line c7
c7z0 - Using Colon-mode c7
c7z0 - Using FTP-cat and FTP-more mode c7
c7z0 - Suppling a port number with the open command c7
c7z0 - Displaying and changing program variables c7
c7z0 - Program variables c7
c7z0 - Listing a remote directory c7
c7z0 - Viewing a remote directory c7
c7z0 - Redisplaying the last directory with your pager c7
c7z0 - Creating a message file on the remote host c7
c7z0 - Looking up site names and addresses c7
c7z0 - Checking the configuration of the program c7
c7z0 - Using the command shell c7
c7z0 - Customizing the prompt c7
c7z0 - Keeping a log of your file transfers c7
c7z0 - A sample RC file c7
c7z0 c7
c7z0 c7
c7z0 Establishing the remote connection: c7
c7z0 Just opening a connection to a remote server was inconvienent enough in the c7
c7z0 stock ftp program to justify writing this program. Here at NCERMRSoft, we c7
c7z0 want to do our business as quickly and painlessly as possible. We'd rather c7
c7z0 save tim e and wear and tear on our metacarpals than bother typing entire c7
c7z0 entire site names, usernames, and email addresses masquerading as c7
c7z0 passwords, and setting binary mode. c7
c7z0 c7
c7z0 We made all connections anonymous by default, and we automatically send our c7
c7z0 email address for the password on those connections. We allowed for site c7
c7z0 names to be abbreviated. c7
c7z0 c7
c7z0 For each commonly accessed site, you can put an entry in your program c7
c7z0 preferences file (let's call it the "ncftpprc" file or "RC" file for c7
c7z0 short). To open the site, from the command shell all you do is type: c7
c7z0 c7
c7z0 open wuarchive.wustl.edu c7
c7z0 c7
c7z0 or c7
c7z0 c7
c7z0 o wuarchive.wustl.edu c7
c7z0 c7
c7z0 As promised, you can abbreviate that further. Just use any abbreviation c7
c7z0 that would match only the site you had in mind. For the previous example, c7
c7z0 you could try: c7
c7z0 c7
c7z0 o wuarc c7
c7z0 o wustl c7
c7z0 o stl c7
c7z0 o wu c7
c7z0 c7
c7z0 Any of those abbreviations would open wuarchive.wustle.edu anonymously, c7
c7z0 sending your anon-password (usually set to your email address) as the c7
c7z0 password. Keep in mind that the program tries opening the first site that c7
c7z0 matches the abbreviation you supplied. So: c7
c7z0 c7
c7z0 o w c7
c7z0 c7
c7z0 might match a site named bowser.nintndo.jp if that site appeared before c7
c7z0 your entry for wuarchive.wustl.edu. c7
c7z0 c7
c7z0 Most of the time we open remote sites anonymously, but there are times c7
c7z0 where you need to specifically open a site with an actual username and c7
c7z0 password. Let's say my partner, Phil Dietz, wants to fetch the latest c7
c7z0 version of the source code to NcFTP so he can optimize something or add a c7
c7z0 new feature behind my back. Since the program opens remote sites c7
c7z0 anonymously by default (actually, you can change this behavior; more on c7
c7z0 that later), he would have to specify a flag to the open command so he can c7
c7z0 supply my username and password. He would try: c7
c7z0 c7
c7z0 o -u sphygmomanometer.unl.edu c7
c7z0 c7
c7z0 or, more likely: c7
c7z0 c7
c7z0 o -u sph c7
c7z0 c7
c7z0 Then the program would prompt him for a username (login, whatever) and a c7
c7z0 password: c7
c7z0 c7
c7z0 Login Name (pdietz): mgleason c7
c7z0 Password: ******** c7
c7z0 c7
c7z0 If he got it right, he could raid my stuff. If not, he'd probably drop me c7
c7z0 an email asking me to quit changing my password so often. c7
c7z0 c7
c7z0 There are even times where you want to FTP from your own account, like if c7
c7z0 you are debuggin an FTP client you wrote. At this prompt: c7
c7z0 c7
c7z0 Login Name (mgleason): c7
c7z0 c7
c7z0 I could just hit return to tell the program that I want "mgleason" as my c7
c7z0 username, then I would enter my password. c7
c7z0 c7
c7z0 c7
c7z0 Format of the RC File: c7
c7z0 This release of the program is somewhat compatible with the stock FTP c7
c7z0 program's .netrc file. However, I can promise you that in the near c7
c7z0 future the program will use a new format, so don't invest to much time in c7
c7z0 it. c7
c7z0 c7
c7z0 The RC file can be named "ncftprc", "netrc" or ".ncftprc", but it is c7
c7z0 usually named ".netrc" so it can be used with the stock FTP program. NcFTP c7
c7z0 looks in the current working directory for any of those files, and then in c7
c7z0 your home directory, and after that it gives up (which is OK, because RC c7
c7z0 files aren't mandatory). c7
c7z0 c7
c7z0 The file usually starts with #set and #unset commands that do things to the c7
c7z0 programs variables. The reason for the "#" is so the stock ftp program will c7
c7z0 think they are comments. You might have this appearing as the first few c7
c7z0 lines in your RC file (I'll explain later): c7
c7z0 c7
c7z0 #set debug 1 c7
c7z0 #set pager "less -EMi" c7
c7z0 #unset startup-msg c7
c7z0 c7
c7z0 After those, you put in machine entries for each of your favorite site. c7
c7z0 Let's put in an entry for wuarchive.wustl.edu. First you would put: c7
c7z0 c7
c7z0 machine wuarchive.wustl.edu c7
c7z0 c7
c7z0 Then you could put in your username, password, and ac7ount if you like: c7
c7z0 c7
c7z0 user anonymous c7
c7z0 password -mgleason@cse.unl.edu c7
c7z0 ac7ount wuarc.does.not.use.ac7ounts c7
c7z0 c7
c7z0 Following that, you could add the startup macro that is run each time you c7
c7z0 connect to wuarchive. You must start it with this line: c7
c7z0 c7
c7z0 macdef init c7
c7z0 c7
c7z0 Then put in the commands you want to do: c7
c7z0 c7
c7z0 cd /graphics/gif c7
c7z0 ls -lt c7
c7z0 c7
c7z0 After that, you end the macro with a blank line (important!). The finished c7
c7z0 machine entry would look like the following. To make the transition to the c7
c7z0 impending new format less painful, I recommend you adhere to this format: c7
c7z0 c7
c7z0 machine wuarchive.wustl.edu c7
c7z0 macdef init c7
c7z0 cd /graphics/gif c7
c7z0 ls -lt c7
c7z0 (mandatory blank line to end the macro) c7
c7z0 c7
c7z0 You can tell the program to not run the startup macro if you supply -i to c7
c7z0 the open command. c7
c7z0 c7
c7z0 Really, you should only bother adding entries for sites that you want to c7
c7z0 run startup macros upon connection. The next section explains why. c7
c7z0 c7
c7z0 c7
c7z0 The Recent-sites file: c7
c7z0 Each time you open a site, the program saves the name of the site and the c7
c7z0 last directory you were in, to the recent-sites file, which is named c7
c7z0 .ncrecent and placed in your home directory. The program saves a c7
c7z0 predetermined number of these sites in the file, and when it reaches the c7
c7z0 the limit, it discards the oldest entry so it can add a new one. c7
c7z0 c7
c7z0 You can just go ahead and use the name of the site you want with the open c7
c7z0 command if you know it is in the recent-file (and you can abbreviate the c7
c7z0 name, just like those in the RC file). But if you cannot remember what the c7
c7z0 name of the site you want, all you do is run the open command with no site c7
c7z0 paramter: c7
c7z0 c7
c7z0 open c7
c7z0 c7
c7z0 This will pop up a list of the sites in the recent-file, and sites in our c7
c7z0 RC file. At the open prompt, just type the name (or an abbreviation of the c7
c7z0 name) or the number preceding the site name to open that site. After c7
c7z0 opening the site you wanted, the program sets the remote working directory c7
c7z0 to the same one you left in the last time you called. c7
c7z0 c7
c7z0 If you don't like the idea of having the sites you called stored on disk, c7
c7z0 you can turn this feature off using an unset command, explained later. c7
c7z0 c7
c7z0 c7
c7z0 Redialing a busy remote site: c7
c7z0 Some remote sites limit the number of leechers, er, anonymous connections c7
c7z0 at a time to reduce the load on the host computer. You can use the open c7
c7z0 command's redial feature to keep attempting connections until you get on, c7
c7z0 although that is not a very polite thing to do. The simplest way to do this c7
c7z0 would be to just supply the -r option: c7
c7z0 c7
c7z0 open -r wuarc c7
c7z0 c7
c7z0 There are also options you can use to tweak redial. The -d flag sets the c7
c7z0 delay between dials, and the -g flag sets a limit on how many dials should c7
c7z0 be attempting before giving up. If you don't supply -g the program will c7
c7z0 dial a day and forever (which my Number Theory professor, Dr. Mientka, says c7
c7z0 is longer than forever and a day) until it connects successfully, or until c7
c7z0 you get sick of waiting and hit the interrupt key (usually ^C). c7
c7z0 c7
c7z0 This example dials wuarchive every ten minutes, giving up after twenty c7
c7z0 attempts. Note that the redial delay is specified in seconds: c7
c7z0 c7
c7z0 open -r -d 600 -g 20 wuarc c7
c7z0 c7
c7z0 Please be considerate when you use redialing, so you won't tax the network. c7
c7z0 Site administrators can and do get angry when they get flooded with c7
c7z0 connections. c7
c7z0 c7
c7z0 c7
c7z0 Supplying a sitename from your shell's command line: c7
c7z0 When you run the program: c7
c7z0 c7
c7z0 ncftp c7
c7z0 c7
c7z0 by itself does nothing and waits for you to type commands to the program's c7
c7z0 own shell. Just like the stock ftp program, you can supply a site name on c7
c7z0 on the command line: c7
c7z0 c7
c7z0 ncftp wuarchive.wustl.edu c7
c7z0 c7
c7z0 You can also use abbreviations as usual: c7
c7z0 c7
c7z0 ncftp wuarc c7
c7z0 c7
c7z0 This is equivalent to running the program, then issuing an open command to c7
c7z0 open wuarchive. c7
c7z0 c7
c7z0 c7
c7z0 Using Colon-mode: c7
c7z0 The open command is not a one-trick pony. Another option is what I call c7
c7z0 colon-mode. This feature is used (most of the time) from your shell's c7
c7z0 command line. c7
c7z0 c7
c7z0 In ancient times, way back during the Disco era, you could use a program c7
c7z0 called tftp to fetch a file using the Internet standard Trivial File c7
c7z0 Transfer Protocol. You could use that program to do something like this c7
c7z0 from within its shell: c7
c7z0 c7
c7z0 get wuarchive.wustl.edu:/graphics/gif/README c7
c7z0 c7
c7z0 and that would call wuarchive and fetch the README file. c7
c7z0 c7
c7z0 You can use this program to do the same thing from your shell's command c7
c7z0 line: c7
c7z0 c7
c7z0 csh> ncftp wuarchive.wustl.edu:/graphics/gif/README c7
c7z0 csh> head README c7
c7z0 c7
c7z0 This tells your shell, in this case the "c-shell" to run NcFTP, which would c7
c7z0 open wuarchive, fetch /graphics/gif/README and write the file /.README in c7
c7z0 in the current working directory, and then exits. This is nice if you don't c7
c7z0 want to browse around the remote site, and you know exactly what you want. c7
c7z0 It would also come in handy in shell scripts, where you don't want to enter c7
c7z0 the command shell, and might not want the program to spew output. c7
c7z0 c7
c7z0 You can use colon-mode to set the starting remote working directory also: c7
c7z0 c7
c7z0 csh> ncftp wuarchive.wustl.edu:/graphics/gif c7
c7z0 c7
c7z0 This would run the program, open wuarchive, and cd to the gif directory, c7
c7z0 then run the program's command shell so you can browse. c7
c7z0 c7
c7z0 Colon-mode is also available from within the program's command shell. At a c7
c7z0 prompt you can do stuff like this: c7
c7z0 c7
c7z0 ncftp> open wuarchive.wustl.edu:/graphics/gif/README c7
c7z0 ncftp> o wuarc:/graphics/gif c7
c7z0 c7
c7z0 c7
c7z0 Using FTP-cat and FTP-more mode: c7
c7z0 There are times where you might not want the program to write a colon-mode c7
c7z0 file in the current working directory, or perhaps you want to pipe the c7
c7z0 output of a remote file into something else. Colon-mode has options to do c7
c7z0 this. It was inspired by the guy who wrote the ftpcat perl script. The -c c7
c7z0 option tells the program to write on the standard output stream. The -m c7
c7z0 option pipes the file into your pager (like more). Of course this won't c7
c7z0 work if the thing you give colon-mode is a directory! This example just c7
c7z0 dumps a remote file to stdout: c7
c7z0 c7
c7z0 csh> ncftp -c wuarc:/graphics/gif/README c7
c7z0 ... c7
c7z0 csh> c7
c7z0 c7
c7z0 This example redirects a remote file into a different location: c7
c7z0 c7
c7z0 csh> ncftp -c wu:/README > ~pdietz/thesis.tex c7
c7z0 c7
c7z0 This one shows how to use a pipeline: c7
c7z0 c7
c7z0 csh> ncftp -c wuarc:/README | tail | wc -l c7
c7z0 10 c7
c7z0 csh> c7
c7z0 c7
c7z0 This shows how to page a remote file: c7
c7z0 c7
c7z0 csh> ncftp -m wuarc:/graphics/gif/README c7
c7z0 ... c7
c7z0 csh> c7
c7z0 c7
c7z0 c7
c7z0 Supplying a port number with the open command: c7
c7z0 This option just didn't fit anywhere else, so to finish out the open c7
c7z0 command, -p lets you supply a port number if you have to ftp to a site c7
c7z0 using an nonstandard port number. Personally, I have yet to use this c7
c7z0 feature, but its there for compatibility with the stock ftp program. c7
c7z0 c7
c7z0 c7
c7z0 Displaying and changing program variables: c7
c7z0 Now I'll explain the commands unique to NcFTP. The others should perform c7
c7z0 the same as they would in the stock ftp program; consult the manual page c7
c7z0 for it if you want those explained, or use the help command for a brief c7
c7z0 blurb. c7
c7z0 c7
c7z0 The show command is used to display program variables and their values. c7
c7z0 c7
c7z0 show all c7
c7z0 c7
c7z0 or c7
c7z0 c7
c7z0 show c7
c7z0 c7
c7z0 would display all the variables with their values. c7
c7z0 c7
c7z0 show var1 var2 ... varN c7
c7z0 c7
c7z0 would display each specified variable and its value. c7
c7z0 c7
c7z0 The set command changes the value of a program variable. Its syntax is: c7
c7z0 c7
c7z0 set varname value c7
c7z0 c7
c7z0 For Boolean or Integer variables, c7
c7z0 c7
c7z0 set varname c7
c7z0 c7
c7z0 would set the value of the variable varname to 1 (true). c7
c7z0 c7
c7z0 The unset command can be used to set the variable to its default value, or c7
c7z0 for Boolean and Integer variables, set the value of the variable to 0 c7
c7z0 (false). For String variables, you can use this to set the value to an c7
c7z0 empty string. c7
c7z0 c7
c7z0 You can use any of those three commands in both the command shell, or in c7
c7z0 the RC file with a "#" prepended. c7
c7z0 c7
c7z0 c7
c7z0 Program variables: c7
c7z0 Each variable can be one of the following types: c7
c7z0 c7
c7z0 Boolean: c7
c7z0 Can be ``on'' or ``off'' (you can also use ``1'' or ''0''. c7
c7z0 c7
c7z0 Integer: c7
c7z0 Can be any positive or negative number, or 0. c7
c7z0 c7
c7z0 String: c7
c7z0 Is a string of characters. If the string needs to have a space in c7
c7z0 it, make sure you surround the whole string with double quotes in a c7
c7z0 set command. c7
c7z0 c7
c7z0 Variables follow. Some variables are explained later in the relevant c7
c7z0 sections. c7
c7z0 c7
c7z0 anon-open (Boolean): c7
c7z0 Tells whether the default login mode is anonymous if on, or if off, c7
c7z0 will prompt for a username/password. You can always override this c7
c7z0 by using either -a or -u with the open command. c7
c7z0 c7
c7z0 anon-password (String): c7
c7z0 Sends this as the password when you login anonymously. By default c7
c7z0 this is your email address. c7
c7z0 c7
c7z0 ansi-escapes (Boolean): c7
c7z0 If on, the program can use boldface, underline, and inverse text. c7
c7z0 c7
c7z0 auto-binary (Boolean): c7
c7z0 If on, sets the transfer type to binary mode immediately after c7
c7z0 connection. c7
c7z0 c7
c7z0 debug (Integer): c7
c7z0 Sets the debugging level. c7
c7z0 c7
c7z0 gateway-login (String): c7
c7z0 Tells which username to use when logging in to your firewall c7
c7z0 gateway host. c7
c7z0 c7
c7z0 gateway-host (String): c7
c7z0 The site which is acting as your firewall gateway, or empty if you c7
c7z0 aren't using one. c7
c7z0 c7
c7z0 local-dir (String): c7
c7z0 The current local working directory. I like to set this from my RC c7
c7z0 file, so all my files go into my download directory. c7
c7z0 c7
c7z0 logfile (String): c7
c7z0 The name of your personal transfer log, or empty if you aren't c7
c7z0 using a transfer log. c7
c7z0 c7
c7z0 logsize (Integer): c7
c7z0 The maximum ceiling of your log file, before the program removes c7
c7z0 old entries. c7
c7z0 c7
c7z0 mprompt (Boolean): c7
c7z0 If on, prompts for each remote file expanded from a wildcard c7
c7z0 globbing expression. c7
c7z0 c7
c7z0 netrc (String, Read-only): c7
c7z0 Tells you the name of the RC file in use. c7
c7z0 c7
c7z0 pager (String): c7
c7z0 The pathname and flags of the program used to display output one c7
c7z0 screenful at a time. The default is the value of your $PAGER c7
c7z0 environment variable. c7
c7z0 c7
c7z0 prompt (String): c7
c7z0 The prompt specification that expands into the prompt. c7
c7z0 c7
c7z0 progress-reports (Integer): c7
c7z0 Which progress meter to use, or 0 if you don't want progress c7
c7z0 reports during file transfers. c7
c7z0 c7
c7z0 recent-list (Boolean): c7
c7z0 If on, uses and updates the recent-file. c7
c7z0 c7
c7z0 remote-is-unix (Boolean): c7
c7z0 Set automatically by the program upon connection, you may need to c7
c7z0 use this in a startup macro if the program guessed that a remove c7
c7z0 site was UNIX when it really is not. c7
c7z0 c7
c7z0 startup-msg (Boolean): c7
c7z0 If on, prints the opening message and tip. c7
c7z0 c7
c7z0 tips (Boolean): c7
c7z0 If on, prints a tip on how to use the program better each time you c7
c7z0 run the program. c7
c7z0 c7
c7z0 type (String): c7
c7z0 The name of the file transfer mode in use, such as "binary" or c7
c7z0 "ascii". c7
c7z0 c7
c7z0 verbose (String/Integer): c7
c7z0 Controls the amount of output spewed by the program. You can supply c7
c7z0 either the first character of the name of the verbosity level, or c7
c7z0 its number: c7
c7z0 c7
c7z0 - Quiet (-1) c7
c7z0 Won't print any output at all, even if an error occurs. c7
c7z0 c7
c7z0 - Errors Only (0) c7
c7z0 No output, except when errors occur. c7
c7z0 c7
c7z0 - Terse (1) c7
c7z0 Prints errors, and useful output from the remote host. c7
c7z0 c7
c7z0 - Verbose (2) c7
c7z0 Prints everything, even junk output from the remote end. c7
c7z0 c7
c7z0 c7
c7z0 Listing a remote directory: c7
c7z0 The ls and dir commands perform in a similar manner to those of the stock c7
c7z0 ftp program. c7
c7z0 c7
c7z0 The ls command sends the FTP command "NLST" for you. This command has been c7
c7z0 set so that it defaults to always listing files in columns (this is the -C c7
c7z0 option given to the UNIX ls command) and appending metacharacters to each c7
c7z0 item name (this is the -F option), so you can see which items are c7
c7z0 directories, files, links, etcetera. If you don't want your items c7
c7z0 columnized, you can try using the -1 option with ls to print one item per c7
c7z0 line. c7
c7z0 c7
c7z0 The dir command sends the FTP command "LIST" for you, which instead of c7
c7z0 printing just item names, i t prints item sizes, owners, dates, and c7
c7z0 permissions as well. This command is equivalent to "ls -l" on most remote c7
c7z0 systems. c7
c7z0 c7
c7z0 The usage for both commands is the same. Here is the one for ls: c7
c7z0 c7
c7z0 ls [-flags] [directory and file names] [redirection] c7
c7z0 c7
c7z0 Note that in this program, you can supply both flags and items to list in c7
c7z0 the same command. The stock version of ftp doesn't let you do this: c7
c7z0 c7
c7z0 ls -lrt /info-mac/help c7
c7z0 c7
c7z0 Another thing that the program does which the others should have done is c7
c7z0 let you supply more than one item: c7
c7z0 c7
c7z0 ls -lrt /info-mac/help /pub /info-mac/README c7
c7z0 c7
c7z0 You can also redirect the output into a file, or pipe it into something. c7
c7z0 This example shows how to list the contents of the current remote c7
c7z0 directory, and save the output into a file in the current local directory: c7
c7z0 c7
c7z0 ls -t >ls.out c7
c7z0 c7
c7z0 Note that for this to work, there must be no whitespace between the ">" and c7
c7z0 the filename, unlike your shell command line which allows for extra c7
c7z0 whitespace. This will be (actually, is) fixed in a future version of the c7
c7z0 program. c7
c7z0 c7
c7z0 These examples show how to use a pipe: c7
c7z0 c7
c7z0 ls -t |tail c7
c7z0 dir -t "|less -CM" c7
c7z0 ls -t "|tail | wc" c7
c7z0 c7
c7z0 Like the redirection example, there must be no whitespace between the first c7
c7z0 pipe character and the rest of the stuff. The trick is that it has to c7
c7z0 appear as one argument to the commands. The second and third examples c7
c7z0 illustrate the use of double quotes to squeeze extra parameters in. The c7
c7z0 second example can be done without all that typing. See the descriptions of c7
c7z0 the pdir and pls commands below. c7
c7z0 c7
c7z0 c7
c7z0 Viewing a remote directory with your pager: c7
c7z0 Didn't you hate it when you listed a remote directory, only to have most of c7
c7z0 the stuff scrolled off your terminal before you could read it? The pls and c7
c7z0 pdir commands take care of this for you. As you might have guessed, they c7
c7z0 perform exactly like their regular counterparts, only you view them with c7
c7z0 your pager. The pager to use is controlled by the pager program variable. c7
c7z0 c7
c7z0 c7
c7z0 Redisplaying the last directory listing: c7
c7z0 The program saves the listing into a local buffer, so if you need to see it c7
c7z0 again (probably forgot abou t pdir) you can use the redir and predir c7
c7z0 commands for this. c7
c7z0 c7
c7z0 c7
c7z0 Fetching files from the remote host: c7
c7z0 The get and mget retrieve remote files for you. The usage for get is: c7
c7z0 c7
c7z0 get remote-file [local-file or redirection] c7
c7z0 c7
c7z0 To fetch /pub/README and write it as a file named ./junk/readme, try: c7
c7z0 c7
c7z0 get /pub/README ./junk/readme c7
c7z0 c7
c7z0 To fetch /pub/README and write it as ./README, just do: c7
c7z0 c7
c7z0 get /pub/README c7
c7z0 c7
c7z0 This lets you fetch a file using its whole pathname, and write a copy of it c7
c7z0 in the current directory, without having to bother with typing a local c7
c7z0 filename. In the unlikely event that you have write permission to a c7
c7z0 directory called /pub on your local machine, it would write "README" in c7
c7z0 that directory. c7
c7z0 c7
c7z0 Most of the time the file you want will be in the current remote directory, c7
c7z0 so you can just do these: c7
c7z0 c7
c7z0 get README c7
c7z0 get README ./junk/readme c7
c7z0 c7
c7z0 You can also use a redirection for get, just like you can with the ls, dir, c7
c7z0 and redir commands. As described earlier, you have to conform to the format c7
c7z0 below for this release of the program: c7
c7z0 c7
c7z0 get README >/dev/null c7
c7z0 get README |head c7
c7z0 get README "|head -8" c7
c7z0 get README "|less -EMi" c7
c7z0 c7
c7z0 The last example is facilitated by the page command described later. c7
c7z0 c7
c7z0 The get command can also use a wildcard expression in an attempt to match c7
c7z0 exactly one remote file. I call it "Poor Man's File Completion". If you've c7
c7z0 done a remote listing, and you decide you want to download a file by the c7
c7z0 name of "obnoxiouslylongpackagename.tar.Z", you can use "PMFC" to save some c7
c7z0 keystrokes. Choose an expression that will only match that one file, then c7
c7z0 use it with get: c7
c7z0 c7
c7z0 get obn*.Z a.tar.Z c7
c7z0 c7
c7z0 If your pattern was unique, get will fetch that file only. If the pattern c7
c7z0 matched more than one file, the program will bitch and moan. c7
c7z0 c7
c7z0 The mget command is used to fetch many files at a time. The difference c7
c7z0 between get and mget is that get lets you write only one file, but you can c7
c7z0 put it in a different directory, while mget fetches many files, always c7
c7z0 writing them in the current local directory. This example fetches several c7
c7z0 remote files at once: c7
c7z0 c7
c7z0 mget a.file.Z b.file.Z c.tar d.tar.Z c7
c7z0 c7
c7z0 The mget command, and its ugly sisters, mput and mdelete let you use c7
c7z0 wildcard expressions. I could have done the previous example as: c7
c7z0 c7
c7z0 mget *.Z c.tar c7
c7z0 c7
c7z0 instead. The "m" commands will verify each file, if you have the program c7
c7z0 variable mprompt set. c7
c7z0 c7
c7z0 c7
c7z0 Viewing a remote file with your pager: c7
c7z0 If you would like to read a file on the remote host without saving a copy c7
c7z0 of it on your machine, you can use the page (or more if you wish) command: c7
c7z0 c7
c7z0 page README c7
c7z0 page obn*README c7
c7z0 page README.Z c7
c7z0 c7
c7z0 The second example show that you can use "PMFC" like you can for get. The c7
c7z0 third example will work also, because if the program knows how to c7
c7z0 decompress the file, it will do so before feeding it to your pager. As c7
c7z0 stated earlier, you can change the program to use to page by setting the c7
c7z0 program variable pager. c7
c7z0 c7
c7z0 c7
c7z0 Creating a message file on the remote host: c7
c7z0 Use the create an empty file on the remote site. Sometimes it is necessary c7
c7z0 to leave a note if you can't get in touch with the remote site's c7
c7z0 administrator. For example if a file is corrupted, you could try: c7
c7z0 c7
c7z0 create Foo.tar_is_corrupt c7
c7z0 c7
c7z0 in hopes that the original uploader will replace it. c7
c7z0 c7
c7z0 c7
c7z0 Looking up site names and addresses: c7
c7z0 You can use the program's builtin mini-nslookup facility. If you wanted to c7
c7z0 know the site's IP number, but only knew the name you could do: c7
c7z0 c7
c7z0 lookup cse.unl.edu c7
c7z0 c7
c7z0 This would spit out IP number for that site, in this case "129.93.1.12". c7
c7z0 If you needed to know what a site's name was, but only knew the IP number, c7
c7z0 try: c7
c7z0 c7
c7z0 lookup 129.93.1.12 c7
c7z0 c7
c7z0 This would spit out the name for that site, in this case "cse.unl.edu". c7
c7z0 c7
c7z0 c7
c7z0 Checking the configuration of the program: c7
c7z0 Use the version command to print version and compilation information about c7
c7z0 the program. This will also tell you which optional features are compiled c7
c7z0 into the program, such as logging to the system log and which command line c7
c7z0 editor (if any) has been installed. c7
c7z0 c7
c7z0 The author's email address is listed, and if you need to report something, c7
c7z0 send the output of this command along with your message. c7
c7z0 c7
c7z0 c7
c7z0 Using the command shell: c7
c7z0 Just like the stock ftp program, you type commands to it until you get c7
c7z0 bored and hit either ^D or type the quit command. c7
c7z0 c7
c7z0 The program supports links to popular command line editing libraries. If c7
c7z0 the person who compiled it went to the effort, you will be able to edit the c7
c7z0 command line with arrow keys and other editing commands, and also scroll up c7
c7z0 and down in the command line history, usually with the up and down arrows. c7
c7z0 You can check the version command to see if either "GETLINE" or "READLINE" c7
c7z0 are installed. c7
c7z0 c7
c7z0 c7
c7z0 Customizing the prompt: c7
c7z0 You can set the shell's prompt string to whatever you like. You can use c7
c7z0 several metacharacters that expand into something each prompt. The "%" c7
c7z0 flags are passed to strftime(3), so you can put the date or time in the c7
c7z0 prompt formatted as you like it: c7
c7z0 c7
c7z0 set prompt "%I:%M ncftp>" c7
c7z0 c7
c7z0 That would the current time in the prompt. c7
c7z0 c7
c7z0 The "@" flags are expanded by the program itself. Here's the list of them. c7
c7z0 c7
c7z0 If you have an ANSI-compatible terminal, or you have the program variable c7
c7z0 ansi-escapes set, you can use @B, @I, and @U to turn on boldface, inverse, c7
c7z0 and underline text respectively (otherwise they won't insert anything). You c7
c7z0 can also use @R to turn on inverse (reverse) text. @P sets the text back to c7
c7z0 plain text. c7
c7z0 c7
c7z0 @D Inserts the full path of the current remote directory. The @J flag is c7
c7z0 similar except it inserts only the directory name. c7
c7z0 c7
c7z0 @H Inserts the name of the remote host. @C inserts the host and current c7
c7z0 directory path in colon-mode format, such as "cse.unl.edu:/pub/mgleason", c7
c7z0 or "(not connected)". The @c flag is similar, only it will insert c7
c7z0 "cse.unl.edu:/pub/mgleason" and a newline if connected, otherwise it prints c7
c7z0 nothing. The default prompt uses this flag to print a two line prompt when c7
c7z0 connected and a one line prompt when not connected. c7
c7z0 c7
c7z0 @E or @! inserts the event number (how many commands you've typed). c7
c7z0 c7
c7z0 @M inserts "(Mail)" if mail has arrived since running the program. c7
c7z0 c7
c7z0 @N inserts a newline character. c7
c7z0 c7
c7z0 c7
c7z0 Keeping a log of your file transfers: c7
c7z0 You can have the program keep a personal log file. I find it is useful so c7
c7z0 I can see where I got a certain file, or what the name of that site was I c7
c7z0 called two weeks ago. c7
c7z0 c7
c7z0 To use a log, add: c7
c7z0 c7
c7z0 #set logfile ~/.ftplog c7
c7z0 c7
c7z0 (or whatever you want to name the log) to your RC file. I don't want my log c7
c7z0 growing too large and using up all my disk space, so I also have: c7
c7z0 c7
c7z0 #set logsize 10240 c7
c7z0 c7
c7z0 in my RC file. If you set the limit on the maximum log size, the program c7
c7z0 will keep the log file at or below that size, discarding old entries. c7
c7z0 c7
c7z0 Note that this is different from having SYSLOG appear in the version c7
c7z0 command's output. When this is on, your actions are recorded to the system c7
c7z0 log, so your system administrator can make sure you aren't doing anything c7
c7z0 "bad". c7
c7z0 c7
c7z0 c7
c7z0Program options: c7
c7z0 Remember that you can treat the command line like an open command, so all c7
c7z0 lowercase options are passed to the open command, and the uppercase options c7
c7z0 are handled by the main program. The uppercase options are described below; c7
c7z0 refer to the open command for descriptions of its options. c7
c7z0 c7
c7z0 -D x sets the debugging level to x. c7
c7z0 c7
c7z0 -H runs the version command and exits, so you can save the output of c7
c7z0 it to use when you need to mail me something. c7
c7z0 c7
c7z0 -I toggles the mprompt variable; this is provided for compatibility c7
c7z0 with "ftp -i". c7
c7z0 c7
c7z0 -N disables reading of the RC file; this is provided for c7
c7z0 compatibility with "ftp -n". c7
c7z0 c7
c7z0 -V x sets verbosity to level x (-1, 0, 1, 2) or (quiet, errs, terse, c7
c7z0 verbose). See the description of the verbose program variable for c7
c7z0 more information. c7
c7z0 c7
c7z0 Here are some example command lines. Again, see the description of the open c7
c7z0 command (especially colon-mode and FTP-cat mode) and all its functions for c7
c7z0 more information. c7
c7z0 c7
c7z0 This just enters the NcFTP command shell: c7
c7z0 c7
c7z0 csh> ncftp c7
c7z0 c7
c7z0 This fetches CONTENTS and then quits: c7
c7z0 c7
c7z0 csh> ncftp cse.unl.edu:/pub/mgleason/CONTENTS c7
c7z0 c7
c7z0 Some others examples, with open options and main program options mixed in: c7
c7z0 c7
c7z0 csh> ncftp -V quiet -u ftp.unl.edu c7
c7z0 csh> ncftp -c cse.unl.edu:/pub/mgleason/CONTENTS c7
c7z0 csh> ncftp -D 2 -r -d 120 -g 10 -N ftp.unl.edu c7
c7z0 c7
c7z0 c7
c7z0 A sample RC file: c7
c7z0 Here is a sample RC file: c7
c7z0 c7
c7z0 #set logfile ~/.ftplog c7
c7z0 #set progress-reports 2 c7
c7z0 #set local-dir /usr/tmp/zz c7
c7z0 #set prompt "@B@E @UNcFTP@P @B@M@D@P ->" c7
c7z0 c7
c7z0 machine sumex-aim.stanford.edu c7
c7z0 macdef init c7
c7z0 cd /info-mac c7
c7z0 get ./help/recent-files.txt "|grep -v '.abs' > sumex c7
c7z0 !less sumex c7
c7z0 pwd c7
c7z0 c7
c7z0 # This site is in here just so I can use "apple" c7
c7z0 # as an abbreviation. c7
c7z0 c7
c7z0 machine ftp.apple.com c7
c7z0 c7
c7z0 # NcFTP will only ask for your password: c7
c7z0 machine cse.unl.edu c7
c7z0 login mgleason c7
c7z0 c7
c7z0 # You can supply a login and a password: c7
c7z0 machine fake.machine.unl.edu c7
c7z0 login mgleason c7
c7z0 password mypass c7
c7z0 macdef init c7
c7z0 cd ./foo/bar c7
c7z0 c7
c7z0 # If an antiquated non-UNIX machine doesn't use c7
c7z0 # the "SYST" command, you may need to unset c7
c7z0 # remote-is-unix, if the remote host complains c7
c7z0 # about "ls -CF". c7
c7z0 machine some.vms.unl.edu c7
c7z0 macdef init c7
c7z0 unset remote-is-unix c7
c7z0 c7
c7z0 c7
c7z0 AUTHORS: c7
c7z0 NcFTP was written by Mike Gleason, NCEMRSoft (mgleason@cse.unl.edu), and c7
c7z0 based on code by the authors of the ftp from the BSD 4.3 distribution. c7
c7z0 NcFTP is copyrighted 1992, 1993 by NCEMRSoft and 1985, 1989 by the Regents c7
c7z0 of California. c7
c7z0 c7
c7z0 Ideas and some code contributed by Phil Dietz, NCEMRSoft c7
c7z0 (pdietz@cse.unl.edu). Testing and debugging done by Phil and Kok Hon Yin c7
c7z0 (hkok@cse.unl.edu). c7
c7z0 c7
c7z0 Extensive man page formatting work by David W. Sanderson c7
c7z0 (dws@ssec.wisc.edu). c7
c7z0 c7
c7z0 c7
c7z0 BUGS: c7
c7z0 Correct execution of many commands depends upon proper behavior by the c7
c7z0 remote server. c7
c7z0 c7
c7z0 The remote server may drop the connection if you take a long time to page c7
c7z0 remote files. c7
c7z0 c7
c7z0 Termcap padding is not correctly displayed. c7
c7z0 c7
c7z0 There are no such sites named: c7
c7z0 c7
c7z0 bowser.nintendo.jp c7
c7z0 or c7
c7z0 sphygmomanometer.unl.edu c7
c7z0 c7
cbz0 [DOCUMENTATION END] c7
c7z0 c7